﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfClient.Proxy;
using System.ServiceModel;

namespace WpfClient
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            Proxy.ServiceContractBaseClient service = new ServiceContractBaseClient();
            Criteria criteria = new Criteria();
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("name", "Eldhose");
            criteria.Parameters = parameters;
            criteria.Entity = "DataServiceFacade";
            criteria.Method = "SayHello";
            try
            {
                MessageBox.Show(service.GetData(criteria).ToString());
            }
            catch (FaultException<MethodNotFoundException> ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
